﻿using Adp.Common;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace NewI.Models
{
    public class NewIContext : DbContext
    {
        public NewIContext(DbContextOptions<NewIContext> options) : base(options)
        {
        }
        public DbSet<NewI_Demo> NewI_Demo { get; set; }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<NewI_Demo>().ToTable("NewI_Demo");
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);
            var log = Fn.GetService<ILoggerFactory>();
            if (log != null)
            {
                optionsBuilder.UseLoggerFactory(log);
            }
        }
    }
}
